package com.student.model;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * FromLetter entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "From_Letter", schema = "dbo", catalog = "StudentManager")
public class FromLetter implements java.io.Serializable {

	// Fields

	private Long fromLetterId;
	private GraduateInfo graduateInfo;
	private EmployCompany employCompany;
	private String letterTitle;
	private String letterContent;
	private Timestamp sendTime;

	// Constructors

	/** default constructor */
	public FromLetter() {
	}

	/** minimal constructor */
	public FromLetter(Long fromLetterId) {
		this.fromLetterId = fromLetterId;
	}

	/** full constructor */
	public FromLetter(Long fromLetterId, GraduateInfo graduateInfo,
			EmployCompany employCompany, String letterTitle,
			String letterContent, Timestamp sendTime) {
		this.fromLetterId = fromLetterId;
		this.graduateInfo = graduateInfo;
		this.employCompany = employCompany;
		this.letterTitle = letterTitle;
		this.letterContent = letterContent;
		this.sendTime = sendTime;
	}

	// Property accessors
	@Id
	@Column(name = "From_Letter_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getFromLetterId() {
		return this.fromLetterId;
	}

	public void setFromLetterId(Long fromLetterId) {
		this.fromLetterId = fromLetterId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Graduate_id")
	public GraduateInfo getGraduateInfo() {
		return this.graduateInfo;
	}

	public void setGraduateInfo(GraduateInfo graduateInfo) {
		this.graduateInfo = graduateInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Company_id")
	public EmployCompany getEmployCompany() {
		return this.employCompany;
	}

	public void setEmployCompany(EmployCompany employCompany) {
		this.employCompany = employCompany;
	}

	@Column(name = "Letter_Title", length = 1024)
	public String getLetterTitle() {
		return this.letterTitle;
	}

	public void setLetterTitle(String letterTitle) {
		this.letterTitle = letterTitle;
	}

	@Column(name = "Letter_Content")
	public String getLetterContent() {
		return this.letterContent;
	}

	public void setLetterContent(String letterContent) {
		this.letterContent = letterContent;
	}

	@Column(name = "Send_Time", length = 23)
	public Timestamp getSendTime() {
		return this.sendTime;
	}

	public void setSendTime(Timestamp sendTime) {
		this.sendTime = sendTime;
	}

}